package com.xiguanlezz.cn.api.naming.utils;

import com.xiguanlezz.cn.api.common.Constants;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author：习惯了种种
 * @CreateDate：2024/11/25 15:35
 * @Description：
 */
public class NamingUtils {

    public static String getGroupedName(String serviceName, final String groupName) {
        if (StringUtils.isBlank(serviceName)) {
            throw new IllegalArgumentException("Param 'serviceName' is illegal, serviceName is blank");
        }
        if (StringUtils.isBlank(groupName)) {
            throw new IllegalArgumentException("Param 'groupName' is illegal, groupName is blank");
        }
        String resultGroupedName = groupName + Constants.SERVICE_INFO_SPLITER + serviceName;
        return resultGroupedName.intern();
    }
}
